using System;
using CookComputing.XmlRpc;
using NMollom.Internal;

namespace NMollom.Internal {
    /// <summary>
    /// The base class representing the minimal required parameters for
    /// each call to Mollom.
    /// </summary>
    public class Params {
        [XmlRpcMember("public_key")]
        public string publicKey;
        public string time;
        public string hash;
        public string nonce;

        /// <summary>
        /// Initializes a new instance of the <see cref="Params"/> class.
        /// </summary>
        /// <param name="auth">The authentication to use.</param>
        public Params(Authentication auth) {
            if (auth == null)
                throw new ArgumentNullException("auth");

            publicKey = auth.PublicKey;
            time = auth.Time;
            hash = auth.Hash;
            nonce = auth.Nonce;
        }
    }
}